<?php

function __autoload($className)
{
    //class directories
    $directories = array(
        '',
        '/',
        'DAL/',
        'Enums/',
        'Logic/',
        'MVC/',
        'MVC/Controller/',
        'MVC/Model/',
        'MVC/ViewModel/',
        'Utils/'
    );

    //for each directory
    foreach ($directories as $directory)
    {
        //see if the file exsists
        if (file_exists($directory.$className . '.php'))
        {
            require_once($directory.$className . '.php');
        }
    }
}

error_reporting(E_ERROR | E_WARNING | E_PARSE);

$loader = new Loader($_GET);
$controller = $loader->CreateController();
$controller->ExecuteAction();

